");
$j("#lightbox-share-notice").show();$j("#lightbox-share-notice").fadeTo(3000,1,function(){$j("#lightbox-share-notice").fadeOut(3000)
})})}});UserPrefixSearch=Class.create();UserPrefixSearch.prototype={initialize:function(C,A,B){this.jfield=$j("#"+C);
this.field=$(C);this.url=A;this.limit=500;this.callback=B.success||function(){};this.errorFunc=B.error||function(){};
this.change=false;this.updater=false;this.prefix="";this.oldValue=false;if($j.browser.safari&&Number($j.browser.version)<500){this.limit=30
}this.getMutualFriendCount(function(D){Event.observe(this.field,"keyup",function(F){clearTimeout(this.change);
this.prefix=this.field.value;if(D0){var E=this.prefix.length>0?500:1000;
if(this.prefix!=this.oldValue){this.change=setTimeout(this.search.bind(this),E)}}else{if(D>this.limit&&this.prefix.length==0){this.errorFunc.apply(this,[{title:"Crikey!",message:"You have lots of friends! Type below to filter them down a bit."}]);
if(this.prefix!=this.oldValue){this.change=setTimeout(this.search.bind(this),E)}}else{this.errorFunc.apply(this,[{message:"We didn't really like your input. Please try again."}])
}}this.oldValue=this.prefix}.bind(this));if(D>this.limit){this.errorFunc.apply(this,[{title:"Crikey!",message:"You have lots of friends! Type below to filter them down a bit."}])
}this.search()})},search:function(){$j.ajax({url:"/ajax/usersearch/mutual.html",type:"POST",data:{prefix:this.prefix,token:tokens.usersearch.mutual},success:function(A){A.length>0?this.callback.apply(this,[A]):this.errorFunc.apply(this,[{title:"Darn!",message:"Your filter had no results. Try being less specific."}])
}.bind(this),error:function(A){this.errorFunc.apply(this,[{title:"Whoops!",message:"We couldn't fetch your friends. Please reopen this window."}])
}.bind(this)})},getMutualFriendCount:function(A){A=A||false;$j.ajax({url:"/ajax/usersearch/mutualCount",type:"POST",dataType:"json",data:{token:tokens.usersearch.mutualCount},success:function(B){return A?A.apply(this,[B.mutualFriendCount]):B.mutualFriendCount
}.bind(this),error:function(B){this.errorFunc.apply(this,[{message:"A pretty bad error occurred. Please reload and try again."}])
}.bind(this)})}};Object.extend(Sharebox.email,{add:function(){var C=$j(".lightbox-email-wrapper");var B=C.length+1;
var A=$j(".lightbox-email-wrapper:last");if(B<7){A.after('')
}if(B==6){$j(".lightbox-add").hide()}},viewMessage:function(){$("lightbox-message-text-toggle").hide();
$("lightbox-message-text").show()},updateAppLink:function(){var B="";$$(".lightbox-email").each(function(C){B+=C.value!=""?C.value+",":""
});B=B.replace(/,$/,"");var A=$("lightbox-email-app");A.href=A.href.replace(/mailto:[^\?]*\?/,"mailto:"+B+"?")
}});